package utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SpecificTime {
		private static Date d1;
		private static Date d2;

		public static String getTime(String s1,String s2) { //("2011-11-28 11:15:11","2011-12-02 11:15:11"
			//设定时间的模板 
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			//得到指定模范的时间
			try {
				d2 = sdf.parse(s2); 
				d1 = sdf.parse(s1);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} 
			//比较 
			if(Math.abs(((d1.getTime() - d2.getTime())/(24*3600*1000))) >=3) { 
				return "超过三天";
				} 
			if(Math.abs(((d1.getTime() - d2.getTime())/(24*3600*1000))) >=3) { 
				return "超过三天";
				}
			return "刚刚"; 
			} 
		
}
